const db = require('../db/index')

// 导入处理路径的 path 核心模块
const path = require('path')

// 获取商品分类数据的处理函数
exports.getGoodsList = (req, res) => {

        db.query('select * from goods_lists order by id asc', (err, results) => {
        // if (err) return res.cc(err)


        res.send({
            code: 0,
            data: [
                {
                    //一级
                    id: 0,
                    name: '推荐',
                    data: [
                        {
                            //二级
                            id: 0,
                            name: '推荐',
                            list: [
                                //三级
                                {
                                    id: 0,
                                    name: '铁观音',
                                    imgUrl: 'https://img1.baidu.com/it/u=3747685723,2990729760&fm=253&fmt=auto&app=138&f=JPEG?w=499&h=319'
                                },
                                {
                                    id: 1,
                                    name: '桂花乌龙',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgfs2.gomein.net.cn%2FT1sTdQBsLv1RCvBVdK_800.jpg%3Fv%3D1&refer=http%3A%2F%2Fgfs2.gomein.net.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668328697&t=5d28d38435a54a539e7fe193504a590a'
                                },
                                {
                                    id: 3,
                                    name: '铁饼',
                                    imgUrl: 'https://img1.baidu.com/it/u=1261732135,3102544786&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                },
                                {
                                    id: 4,
                                    name: '紫砂壶',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg1.99114.com%2Fgroup1%2FM00%2FA0%2F38%2FwKgGTFj-sAiABvbFAABn0Ztao7E348.jpg&refer=http%3A%2F%2Fimg1.99114.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668330033&t=00f6b23aea225e2eb792e9005e01e068'
                                },
                                {
                                    id: 5,
                                    name: '龙井',
                                    imgUrl: 'https://img0.baidu.com/it/u=3949428449,236506462&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                },
                                {
                                    id: 6,
                                    name: '武夷岩茶',
                                    imgUrl: 'https://img2.baidu.com/it/u=2739632429,2905552780&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                },
                                {
                                    id: 7,
                                    name: '茶杯',
                                    imgUrl: 'https://img0.baidu.com/it/u=588003752,2654544099&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=329'
                                },
                                {
                                    id: 8,
                                    name: '茶宠',
                                    imgUrl: 'https://img1.baidu.com/it/u=2899686954,2272268307&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                },
                            ]
                        }
                    ]
                },
                {
                    //一级
                    id: 1,
                    name: '绿茶',
                    data: [
                        {
                            //二级
                            id: 1,
                            name: '绿茶',
                            list: [
                                //三级
                                {
                                    id: 0,
                                    name: '龙井',
                                    imgUrl: 'https://img0.baidu.com/it/u=174149987,3233167841&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=300'
                                },
                                {
                                    id: 1,
                                    name: '碧螺春',
                                    imgUrl: 'https://img0.baidu.com/it/u=1153313524,113282652&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=333'
                                },
                                {
                                    id: 3,
                                    name: '雀舌',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.huohuasai.org.cn%2Fcha%2FupFiles%2FinfoImg%2Fcoll%2F20200328%2FOT20200328131758774.jpg&refer=http%3A%2F%2Fwww.huohuasai.org.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668328521&t=8a4adb6f968e97f1e639283ff157b24a'
                                },
                                {
                                    id: 4,
                                    name: '安吉白茶',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fbkimg.cdn.bcebos.com%2Fpic%2F8b13632762d0f703eacc038a07fa513d2697c56e&refer=http%3A%2F%2Fbkimg.cdn.bcebos.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668328659&t=bcded8e8c859e0cac2001263fd0f5810'
                                },
                                {
                                    id: 5,
                                    name: '六安瓜片',
                                    imgUrl: 'https://img2.baidu.com/it/u=1214526775,209022228&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                }
                            ]
                        }
                    ]
                },
                {
                    //一级
                    id: 2,
                    name: '乌龙',
                    data: [
                        {
                            //二级
                            id: 3,
                            name: '乌龙',
                            list: [
                                //三级
                                {
                                    id: 0,
                                    name: '桂花乌龙',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgfs2.gomein.net.cn%2FT1sTdQBsLv1RCvBVdK_800.jpg%3Fv%3D1&refer=http%3A%2F%2Fgfs2.gomein.net.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668328697&t=5d28d38435a54a539e7fe193504a590a'
                                },
                                {
                                    id: 1,
                                    name: '武夷山',
                                    imgUrl: 'https://img2.baidu.com/it/u=863998337,2107768256&fm=253&fmt=auto&app=138&f=JPEG?w=540&h=413'
                                },
                                {
                                    id: 3,
                                    name: '梨山茶',
                                    imgUrl: 'https://img2.baidu.com/it/u=2309971899,3968066275&fm=253&fmt=auto&app=138&f=JPEG?w=650&h=433'
                                }
                            ]
                        }
                    ]
                },
                {
                    //一级
                    id: 3,
                    name: '红茶',
                    data: [
                        {
                            //二级
                            id: 4,
                            name: '红茶',
                            list: [
                                //三级
                                {
                                    id: 0,
                                    name: '祁门红茶',
                                    imgUrl: 'https://pic.rmb.bdstatic.com/16d33373e1ee9c3a7e12bdd8de7fcff0.jpeg'
                                },
                                {
                                    id: 1,
                                    name: '正山小种',
                                    imgUrl: 'https://img0.baidu.com/it/u=919074689,686123034&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                },
                                {
                                    id: 3,
                                    name: '英德红茶',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.qdlsc.com%2FUpload%2F1615260906.jpeg&refer=http%3A%2F%2Fwww.qdlsc.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668328979&t=92140f562291aa35a127d9c150136bf2'
                                },
                                {
                                    id: 4,
                                    name: '川红',
                                    imgUrl: 'https://img1.baidu.com/it/u=260086960,2279279155&fm=253&fmt=auto&app=138&f=JPEG?w=720&h=500'
                                },
                                {
                                    id: 5,
                                    name: '宜红',
                                    imgUrl: 'https://img0.baidu.com/it/u=3003939901,36631760&fm=253&fmt=auto&app=138&f=JPEG?w=700&h=467'
                                },
                                {
                                    id: 5,
                                    name: '苏红和越红',
                                    imgUrl: 'https://img2.baidu.com/it/u=2142118983,1396681187&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                }
                            ]
                        }
                    ]
                },
                {
                    //一级
                    id: 4,
                    name: '白茶',
                    data: [
                        {
                            //二级
                            id: 5,
                            name: '白茶',
                            list: [
                                //三级
                                {
                                    id: 0,
                                    name: '白牡丹',
                                    imgUrl: 'https://img2.baidu.com/it/u=3233585058,799597260&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                },
                                {
                                    id: 1,
                                    name: '白毫银针',
                                    imgUrl: 'https://img2.baidu.com/it/u=2198812781,1956897819&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=326'
                                },
                                {
                                    id: 3,
                                    name: '贡眉',
                                    imgUrl: 'https://img0.baidu.com/it/u=3949091250,1954399626&fm=253&fmt=auto&app=138&f=JPEG?w=578&h=372'
                                },
                                {
                                    id: 4,
                                    name: '寿眉',
                                    imgUrl: 'https://img0.baidu.com/it/u=1662854408,1220643370&fm=253&fmt=auto&app=138&f=JPEG?w=535&h=500'
                                }
                            ]
                        }
                    ]
                },
                {
                    //一级
                    id: 5,
                    name: '普洱',
                    data: [
                        {
                            //二级
                            id: 6,
                            name: '普洱',
                            list: [
                                //三级
                                {
                                    id: 0,
                                    name: '饼茶',
                                    imgUrl: 'https://img1.baidu.com/it/u=2736534422,857648803&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=333'
                                },
                                {
                                    id: 1,
                                    name: '沱茶',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.alicdn.com%2Fimgextra%2Fi1%2F12411736%2FT2GH2YXcRaXXXXXXXX_%21%2112411736.jpg&refer=http%3A%2F%2Fimg.alicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668329379&t=cbab4f310d61e0d5826aaf2d63ab9ba0'
                                },
                                {
                                    id: 3,
                                    name: '砖茶',
                                    imgUrl: 'https://img1.baidu.com/it/u=1405857994,4203090576&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=503'
                                },
                                {
                                    id: 4,
                                    name: '柱茶',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.alicdn.com%2Fbao%2Fuploaded%2FO1CN01VvnxVZ1f7GhZ4m0s2_%21%216000000003959-0-yinhe.jpg&refer=http%3A%2F%2Fimg.alicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668329432&t=d971af134e16c1eef1bd3d2a1b549a55'
                                },
                                {
                                    id: 5,
                                    name: '铁饼',
                                    imgUrl: 'https://img1.baidu.com/it/u=1261732135,3102544786&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                }
                            ]
                        }
                    ]
                },
                {
                    //一级
                    id: 6,
                    name: '茶具',
                    data: [
                        {
                            //二级
                            id: 7,
                            name: '茶具',
                            list: [
                                //三级
                                {
                                    id: 0,
                                    name: '茶杯',
                                    imgUrl: 'https://img0.baidu.com/it/u=588003752,2654544099&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=329'
                                },
                                {
                                    id: 1,
                                    name: '茶宠',
                                    imgUrl: 'https://img1.baidu.com/it/u=2899686954,2272268307&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                },
                                {
                                    id: 3,
                                    name: '煮水器电炉壶',
                                    imgUrl: 'https://img2.baidu.com/it/u=2532583899,1609177992&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                },
                                {
                                    id: 4,
                                    name: '茶叶罐',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Ff04e89427ba812616c03430d4c949341e2ee2033491d-CzsvPw_fw658&refer=http%3A%2F%2Fhbimg.b0.upaiyun.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668329702&t=55cfd0805a07167134b209df59e46a3a'
                                },
                                {
                                    id: 5,
                                    name: '品茗杯',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg2.99114.com%2Fgroup10%2FM00%2F24%2FB9%2FrBADs1opW3eALpKcAAClrclmIG0892.jpg&refer=http%3A%2F%2Fimg2.99114.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668329733&t=4d0521d0b228b5406b7436febc359f8f'
                                },
                                {
                                    id: 6,
                                    name: '茶盘',
                                    imgUrl: 'https://img1.baidu.com/it/u=2007654545,1910095332&fm=253&fmt=auto&app=138&f=JPEG?w=479&h=320'
                                },
                                {
                                    id: 7,
                                    name: '茶壶',
                                    imgUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimgservice.suning.cn%2Fuimg1%2Fb2c%2Fimage%2F18moxQApZBbvxuG827gvoQ.jpg_800w_800h_4e&refer=http%3A%2F%2Fimgservice.suning.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668329558&t=9944d75bb4fc64e5c21b13240c74401f'
                                },
                                {
                                    id: 8,
                                    name: '香道',
                                    imgUrl: 'https://img0.baidu.com/it/u=1084591073,1600879161&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
                                }
                            ]
                        }
                    ]
                }

            ]
        })
    })
}